<?php 
namespace app\admin\validate;
use think\validate;
class CategoryValidate extends Validate{
    //验证规则
    protected $rule = array(
		'name' => 'max:90',
		'parent_id'=>'number',
		'parent_id_path' => 'max:128',
        	);
    //验证失败提示信息
    protected $message = array(
		'name.max'=>'商品分类名称的值不能超过90个字符',
		'parent_id.number'=>'父id的值必须是一个整数',
		'parent_id_path.max'=>'家族图谱的值不能超过128个字符',
);
    //验证场景
    protected $scene = array(
		'add'=>array('name','parent_id','parent_id_path','sort_order','is_show','image'),
		'edit'=>array('id','name','parent_id','parent_id_path','sort_order','is_show','image'),
	);

}